package org.batatasframework.support.charts;

public class ResultArrayItem {
	
	/** 数据源的下标 */
	private int sourceIndex;
	
	/** 对应的结果集的下标 */
	private int targetIndex;
	
	public void read(Object[] sourceArray, Object[] targetArray){
		Object sv = sourceArray[sourceIndex];
		Object tv = targetArray[targetIndex];
		if(null == tv){
			targetArray[targetIndex] = calculate(sv);
		}else{
			targetArray[targetIndex] = calculate(sv, tv);
		}
	}
	
	public Object calculate(Object val){
		return val;
	}

	public Object calculate(Object sourceValue, Object targetValue){
		return targetValue;
	}
	
//	/** {@value #val} */
//		final static long val =  0B00011011;
//		final static long val1 = 0B11111110;
//		
//	public static void main(String[] ars){
//	}
}
